package cn.itsource.controller.app;

import cn.itsource.pojo.ro.CarInfoRo;
import cn.itsource.result.JSONResult;
import cn.itsource.service.ICustomerCarService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@Tag(name = "小程序车辆信息")
@RequestMapping("/app/customerCar")
public class AppCustomerCarController {
    @Autowired
    private ICustomerCarService customerCarService;
    @GetMapping("/list")
    public JSONResult list(){
        return JSONResult.success(customerCarService.list());
    }
    @PostMapping("/add")
    public JSONResult add(@RequestBody @Valid CarInfoRo carInfoRo){
        customerCarService.add(carInfoRo);
        return JSONResult.success();
    }
}
